home *** CD-ROM | disk | FTP | other *** search
/ C++ für Kids / C++ for kids.iso / Buch / Noten1a.cpp < prev    next >
C/C++ Source or Header  |  1998-12-13  |  1KB  |  33 lines

  1. //---------------------------------------------------------------------------
  2. #include <vcl\vcl.h>
  3. #pragma hdrstop
  4.  
  5. #include "Noten1a.h"
  6. //---------------------------------------------------------------------------
  7. #pragma resource "*.dfm"
  8. TForm1 *Form1;
  9. int Zensur;
  10. //---------------------------------------------------------------------------
  11. __fastcall TForm1::TForm1(TComponent* Owner)
  12.     : TForm(Owner)
  13. {
  14. }
  15. //---------------------------------------------------------------------------
  16. void __fastcall TForm1::Button1Click(TObject *Sender)
  17. {
  18.   try
  19.   {
  20.     Zensur = StrToInt (Edit1->Text);
  21.     if (Zensur == 1) Label1->Caption = "sehr gut";
  22.     if (Zensur == 2) Label1->Caption = "gut";
  23.     if (Zensur == 3) Label1->Caption = "befriedigend";
  24.     if (Zensur == 4) Label1->Caption = "ausreichend";
  25.     if (Zensur == 5) Label1->Caption = "mangelhaft";
  26.     if (Zensur == 6) Label1->Caption = "ungenⁿgend";
  27.   }
  28.   catch (...)
  29.   {
  30.     Label1->Caption = "Quatsch!";
  31.   }
  32. }
  33. //---------------------------------------------------------------------------